Repository navigation
id(web): accept u64 values above 2^53 in the TS shell-contract checker (#1441) - #2874
Conversation
#1441) The TS port capped every u64 at Number.MAX_SAFE_INTEGER while the Rust checker caps at u64::MAX and the contract leaves most u64 fields open, so contract-valid frames (install_begin seeds, view/records sequences) were falsely rejected with a bound that appears nowhere in the contract. u64 is now checked on its own: non-negative integers are accepted at any JS-representable magnitude (a wire value above 2^53 arrives rounded and cannot be proven out of range), while the bounds JS can check exactly still are -- an explicit min, and an explicit max within the safe range (total_bytes <= 16777216 still rejects). Regression tests pin the parity cases from #1441; the one failing web test (search-panel accessibility) fails identically on clean main.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d02d9a1694
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ntract checker (#1441) 2^64 is the rounded wire form of u64::MAX itself and stays accepted, but anything above it (2**65, 1e100) is unambiguously out of range and the Rust checker rejects it via value.as_u64() -- the TS port must too, or conformance tests would approve frames the host rejects. Pins the Codex P2 boundary cases in world-contract.test.ts.
|
🤖 Agent note · done
|
What
Fixes #1441: the TypeScript shell-contract checker capped every
u64field atNumber.MAX_SAFE_INTEGER, while the Rust checker capsu64atu64::MAXand the contract leaves mostu64fields open — so contract-valid frames (install_beginseeds,view/recordssequences at or above 2^53, a value class the system itself produces) were falsely rejected with a bound that appears nowhere in the contract.How
checkValueinpkgs/id/web/src/shell-contract.tsnow handlesu64on its own, mirroring the Rust verdicts within JS precision limits:minis enforced; an explicitmaxwithin the safe range (e.g.total_bytes≤ 16777216) still rejects above-max values.u16/u32caps are unchanged; the Rust checker and the contract JSON are untouched.9007199254740991.world-contract.test.tspin the parity cases: seed = 2^53 and the JSON-parsed form of u64::MAX accepted,view/recordssequences at 2^53 accepted, and the exactly-checkable bounds still rejecting.Verification
bun x vitest run src/world-contract.test.ts— 17/17 pass (laptop).bun run typecheck— clean.search-panel.test.ts(accessibility role) that fails identically on clean main — pre-existing, unrelated.Queue task 1748 (resumed from a park whose only blocker was the 2026-10-28 laptop SSH outage).
Need help on this PR? Tag
@codesmith-botwith what you need.